package Eyjafjalla.card.skill;

import Eyjafjalla.action.DrawCloudAction;
import Eyjafjalla.card.AbstractEyjafjallaCard;
import Eyjafjalla.power.FireMarkPower;
import com.megacrit.cardcrawl.actions.common.ApplyPowerAction;
import com.megacrit.cardcrawl.actions.common.GainBlockAction;
import com.megacrit.cardcrawl.cards.AbstractCard;
import com.megacrit.cardcrawl.characters.AbstractPlayer;
import com.megacrit.cardcrawl.core.CardCrawlGame;
import com.megacrit.cardcrawl.localization.CardStrings;
import com.megacrit.cardcrawl.monsters.AbstractMonster;

public class BurnGround_Eyjafjalla extends AbstractEyjafjallaCard {
    public static final String ID = "BurnGround_Eyjafjalla";
    private static final CardStrings cardStrings;

    public BurnGround_Eyjafjalla(){
        super(ID, cardStrings.NAME,1,cardStrings.DESCRIPTION, AbstractCard.CardType.SKILL, AbstractCard.CardRarity.BASIC, AbstractCard.CardTarget.SELF);
        this.baseMagicNumber = 1;
        this.magicNumber = 1;
        setFireDescription(cardStrings.EXTENDED_DESCRIPTION[0]);
    }

    @Override
    public AbstractCard makeCopy() {
        return new BurnGround_Eyjafjalla();
    }

    @Override
    public void use(AbstractPlayer p, AbstractMonster m) {
        addToBot(new ApplyPowerAction(p,p,new FireMarkPower(p,magicNumber),magicNumber));
        addToBot(new DrawCloudAction(2));
    }

    @Override
    protected void applyPowersToBlock() {
        int trueB = baseMagicNumber;
        if(isFire()){
            baseMagicNumber+=1;
        }
        super.applyPowersToBlock();
        magicNumber = baseMagicNumber;
        baseMagicNumber = trueB;
        isMagicNumberModified = baseMagicNumber!=magicNumber;
    }

    @Override
    public void upgrade() {
        if(!this.upgraded){
            upgradeName();
            upgradeMagicNumber(1);
        }
    }

    static {
        cardStrings = CardCrawlGame.languagePack.getCardStrings(ID);
    }
}


